{
  LW Environ -- LightWave Environments

  This header defines the enviroment render handler for backdrops and fog.

  Based on lwenviron.h which is:
  Copyright 1999, NewTek, Inc.
}

{
  Copyright 2012, Jameel Halabi

  This unit is part of the BlaiseWave wrapper,
  which is licensed under the BSD 2-Clause license (see licenses/license.txt).
}

unit LW_Environ;

{$mode objfpc}{$H+}

interface

uses
  LW_Types, LW_Handler, LW_Render;

const
  LWENVIRONMENT_HCLASS	= 'EnvironmentHandler'    ;
  LWENVIRONMENT_ICLASS	= 'EnvironmentInterface'  ;
  LWENVIRONMENT_GCLASS	= 'EnvironmentGizmo'      ;
  LWENVIRONMENT_VERSION	= 4                       ;

  // enum LWEnvironmentMode
  EHMODE_PREVIEW        = 0;
  EHMODE_REAL           = 1;

  LWENF_TRANSPARENT	= 1 shl 0;

type
  PLWEnvironmentAccess = ^TLWEnvironmentAccess;
  TLWEnvironmentAccess = record
    Mode    : Integer                      ; // Originally TLWEnvironmentMode
    H 					   ,
    P	    : Array [0..1] of Double       ;
    Dir     : TLWDVector                   ;
    ColRect : Array [0..3 , 0..2] of Double ;
    Color   : Array [0..2] of Double       ;
  end;

  PLWEnvironmentHandler = ^TLWEnvironmentHandler;
  TLWEnvironmentHandler = record
    Inst     : PLWInstanceFuncs ;
    Item     : PLWItemFuncs     ;
    Rend     : PLWRenderFuncs   ;
    Evaluate : function
               (      Instance : PLWInstance          ;
                const Access   : PLWEnvironmentAccess ) : PLWError ;
    Flags    : function
               (      Instance : PLWInstance          ) : UInt32   ;
  end;

implementation

end.

